Skip to content

Conversation

@pdgendt
Copy link
Contributor

@pdgendt pdgendt commented Apr 3, 2024

Add symbols to select a C standard. Next to an option, hidden symbols are available to select the minimum.
This allows subsystems or modules to select the minimum compliant C standard supported.

Copy link
Member

@aescolar aescolar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this seems fine to me. My only doubt is about having a new lib/c folder just for this (which would be orphaned maintainer wise)

@pdgendt
Copy link
Contributor Author

pdgendt commented Apr 3, 2024

Overall this seems fine to me. My only doubt is about having a new lib/c folder just for this (which would be orphaned maintainer wise)

I was looking for a logical place to put it, but didn't find it obvious. If a more suitable place can be suggested, I can move it.

@aescolar
Copy link
Member

aescolar commented Apr 3, 2024

Overall this seems fine to me. My only doubt is about having a new lib/c folder just for this (which would be orphaned maintainer wise)

I was looking for a logical place to put it, but didn't find it obvious. If a more suitable place can be suggested, I can move it.

What about Kconfig.zephyr ? Maybe inside the compiler options menu?

Copy link
Contributor

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for this proposal.

Two minor improvement proposals.

@pdgendt pdgendt force-pushed the compiler-cstd branch 2 times, most recently from f99592b to a43a053 Compare April 3, 2024 09:02
@zephyrbot zephyrbot added the area: Toolchains Toolchains label Apr 3, 2024
aescolar
aescolar previously approved these changes Apr 3, 2024
@zephyrbot
Copy link

zephyrbot commented Apr 3, 2024

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@zephyrbot zephyrbot added manifest manifest-zcbor DNM This PR should not be merged (Do Not Merge) labels Apr 3, 2024
@pdgendt pdgendt force-pushed the compiler-cstd branch 2 times, most recently from 9be6acc to b6af3b4 Compare April 15, 2024 19:14
@zephyrbot zephyrbot requested a review from yonsch April 15, 2024 19:14
Copy link
Contributor

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

But fail to understand the reason for the ZEPHYR_TOOLCHAIN_SUPPORTS_GNU_EXTENSIONS setting.

tejlmand
tejlmand previously approved these changes Apr 23, 2024
Use vanilla cmake FATAL_ERROR messages instead of assert.

Signed-off-by: Pieter De Gendt <[email protected]>
@pdgendt
Copy link
Contributor Author

pdgendt commented Apr 24, 2024

Rebased to resolve conflict in release notes, PTAL @tejlmand @stephanosio

Copy link
Member

@stephanosio stephanosio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objection to this as long as the plan is to use Kconfig for handling toolchain capabilities and configurations.

Just a minor nit about the Kconfig naming.

pdgendt added 6 commits April 24, 2024 15:26
Add symbols to select a C standard. Next to an option, hidden symbols
are available to select the minimum.
This allows subsystems or modules to select the least compliant C
standard supported.

Signed-off-by: Pieter De Gendt <[email protected]>
Add a symbol to enable GNU C Extensions. And a hidden option for
toolchains to signal GNU Extensions support.

Signed-off-by: Pieter De Gendt <[email protected]>
Replace the global CSTD property with the CSTD kconfig option to select
at least C11 standard.

Signed-off-by: Pieter De Gendt <[email protected]>
Replace the global CSTD property with a Kconfig symbol selection.

Signed-off-by: Pieter De Gendt <[email protected]>
Add an entry that the CSTD cmake property is deprecated and replaced
with a kconfig choice.

Signed-off-by: Pieter De Gendt <[email protected]>
Replace the bindesc testcase CSTD definitions with the newly introduced
kconfig symbols.

Signed-off-by: Pieter De Gendt <[email protected]>
@pdgendt pdgendt requested a review from tejlmand April 24, 2024 14:06
@fabiobaltieri fabiobaltieri merged commit 4d1ae8c into zephyrproject-rtos:main Apr 25, 2024
@pdgendt pdgendt deleted the compiler-cstd branch April 25, 2024 09:55
coreboot-bot pushed a commit to coreboot/chrome-ec that referenced this pull request Apr 30, 2024
Zephyr PR #71024[1] deprecated CSTD global variable for selecting C
standard. Appropriate Kconfig options should be used instead.

[1] zephyrproject-rtos/zephyr#71024

BUG=b:321092852
TEST=zmake build bloonchipper

Change-Id: I3debb2d9ffc7295ddfbbbd7a84dda51db3fd90a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/5498197
Tested-by: Patryk Duda <[email protected]>
Commit-Queue: Patryk Duda <[email protected]>
Code-Coverage: Zoss <[email protected]>
Reviewed-by: Tom Hughes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants